﻿namespace Interface
{
    /// <summary>
    /// 日志模块
    /// </summary>
    public static class Log
    {
        private static ILogger Logger;

        private static ILogger s_EmptyLogger = new EmptyLogger();

        static Log()
        {
            Logger = s_EmptyLogger;
        }

        public static void SetLogger(ILogger logger)
        {
            Logger = logger;
        }

        public static void SetEmptyLogger()
        {
            Logger = s_EmptyLogger;
        }

        public static void Debug(object message)
        {
            Logger.Debug(message);
        }

        public static void Debug(string format, params object[] args)
        {
            Logger.Debug(format, args);
        }

        public static void Info(object message)
        {
            Logger.Info(message);
        }

        public static void Info(string format, params object[] args)
        {
            Logger.Info(format, args);
        }

        public static void Warning(object message)
        {
            Logger.Warning(message);
        }

        public static void Warning(string format, params object[] args)
        {
            Logger.Warning(format, args);
        }

        public static void Error(object message)
        {
            Logger.Error(message);
        }

        public static void Error(string format, params object[] args)
        {
            Logger.Error(format, args);
        }
    }
}
